home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2000 September / september_2000.iso / intercd / root / ^Linux / WindowMaker / WINGs / testmywidget.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-09-29  |  863 b   |  52 lines

  1.  
  2.  
  3. #include <WINGs.h>
  4. #include <WUtil.h>
  5.  
  6. #include "mywidget.h"
  7.  
  8.  
  9. void
  10. wAbort()
  11. {
  12.     exit(1);
  13. }
  14.  
  15.  
  16. int main(int argc, char **argv)
  17. {
  18.     Display *dpy = XOpenDisplay("");
  19.     WMScreen *scr;
  20.     WMWindow *win;
  21.     MyWidget *thing;
  22.  
  23.  
  24.     WMInitializeApplication("Test", &argc, argv);
  25.     
  26.     if (!dpy) {
  27.     wfatal("could not open display");
  28.     exit(1);
  29.     }
  30.     
  31.     scr = WMCreateSimpleApplicationScreen(dpy);
  32.  
  33.     /* init our widget */
  34.     InitMyWidget(scr);
  35.     
  36.     win = WMCreateWindow(scr, "test");
  37.     WMResizeWidget(win, 150, 50);
  38.     
  39.     thing = CreateMyWidget(win);
  40.     SetMyWidgetText(thing, "The Test");
  41.     WMResizeWidget(thing, 100, 20);
  42.     WMMoveWidget(thing, 10, 10);
  43.     
  44.     WMRealizeWidget(win);
  45.     WMMapSubwidgets(win);
  46.     WMMapWidget(win);
  47.     
  48.     WMScreenMainLoop(scr);
  49.     
  50.     return 0;
  51. }
  52.